@isTest
private class SalesAreaBudgetExecSheetHandlerTest{
    static testMethod void testMethod1() {
        ///创建用户
        Id ldcProfile = [Select Id From Profile Where Name ='系统管理员' or Name='System Administrator'].Id;
         User u1 = new User( Alias = 'samLdc1', 
                         Email = 'ldc@test.com.maike',
                         Emailencodingkey = 'UTF-8', 
                         Lastname = '用户1', 
                         Languagelocalekey = 'en_US',
                         Localesidkey = 'en_US', 
                         Profileid = ldcProfile, 
                         Country = 'United States',
                         IsActive = true,
                         SubCompany__c='四川省迈克实业有限公司',
                         UserDepartment__c='客户服务中心(工程部)',
                         Timezonesidkey = 'America/Los_Angeles', 
                         EmployeeNumber = '123456',
                         Username = 'Matldc1@test.com.maike' ,
                         AreaCode__c = 'C1234567890');
        
        insert u1;
        
        ///创建销售区域预算执行明细
        SalesAreaBudgetExecSheet__c sa = new SalesAreaBudgetExecSheet__c();
        sa.RegionCoding__c = 'C1234567890';
        insert sa;
        
        SalesAreaBudgetExecSheet__c s = [select Id from SalesAreaBudgetExecSheet__c where Id =:sa.Id];
        update sa;
        //比较所有人
        System.assertEquals(u1.Id ,[select OwnerId from SalesAreaBudgetExecSheet__c where id =:sa.Id].OwnerId);
        
        
    
    }   
}